/*
//
//               INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 2002-2006 Intel Corporation. All Rights Reserved.
//
*/

#ifndef __SBRDEC_OWN_INT_H__
#define __SBRDEC_OWN_INT_H__

/********************************************************************/

#include "ippac.h"
#include "ipps.h"

/********************************************************************/

Ipp32s sbri_ownAnalysisFilter_SBRHQ_32s_D2L(Ipp32s* pSrc,
                                            Ipp32sc* pDst[],
                                            Ipp32s nSubBand,
                                            Ipp32s kx,
                                            IppsFilterSpec_SBR_C_32sc* pSpec);


/****************************************************************************************/
Ipp32s sbri_ownAnalysisFilter_SBRLP_32s_D2L(Ipp32s* pSrc,
                                            Ipp32s* pDst[],
                                            Ipp32s nSubBand,
                                            Ipp32s kx,
                                            IppsFilterSpec_SBR_R_32s* pSpec);


/****************************************************************************************/

/* -------------------------------- MATH PART OF SBR DEC ---------------------------- */

#define MUL64_SBR_64S(x, y)  \
  ( ( (Ipp64s)((Ipp64s)(x) * (Ipp64s)(y)) ) )

#define MUL32_SBR_32S(x, y) \
  (Ipp32s)(((Ipp64s)((Ipp64s)(x) * (Ipp64s)(y)))>>32)

Ipp32s sbri_CLZ( Ipp32s maxVal );

Ipp32s sbriSqrtWrap_64s_Sfs(Ipp32s inData, Ipp32s inScaleFactor, Ipp32s *outScaleFactor);

Ipp32s sbriInvWrap_32s_Sf(Ipp32s x, Ipp32s* outScaleFactor);

Ipp32s sbriChangeScaleFactor(Ipp32s inData, Ipp32s inScaleFactor, Ipp32s outScaleFactor);

#endif //__SBRDEC_OWN_INT_H__
